package com.mofang.powerdekorhelper.witget;

import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;

import com.mofang.powerdekorhelper.R;


/**
 * Created by luofei on 2017/5/2 0002.
 */

public class MySwipeRefreshLayout extends SwipeRefreshLayout {

    public MySwipeRefreshLayout(Context context) {
        super(context);
        setColorSchemeColors(getResources().getIntArray(R.array.swipe_refresh_colors));
    }

    public MySwipeRefreshLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        setColorSchemeColors(getResources().getIntArray(R.array.swipe_refresh_colors));
    }

    public void show() {
        post(new Runnable() {
            @Override
            public void run() {
                setRefreshing(true);

            }
        });
    }

    public void hide() {
        setRefreshing(false);
    }
}
